package com.team1160.scouting.panels;

import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import com.team1160.scouting.elements.NextButton;
import com.team1160.scouting.resourcePackets.CardLayoutPacket;

/**
 * the splash panel of the app.
 * only has an image and a next button.<br><br><br>
 * 
 *
 *
 * @author Saketh Kasibatla
 */
public class InitialPanel extends JPanel{

    /**
     * the toolbar displayed at the top.
     */
    JToolBar toolbar;

    /**
     * the panel containing the pictures under the toolbar
     */
    JPanel picturepanel;

    /**
     * the layout packet containing the cardlayout for the next button.
     */
    CardLayoutPacket layout;


    /**
     * creates a new splash panel.
     * @param layout the layout packet to add to the button.
     */
    public InitialPanel(CardLayoutPacket layout) {
        this.layout = layout;
        this.setLayout(new BorderLayout());

        toolbar = new JToolBar();
        toolbar.setLayout(new BorderLayout());
        NextButton next = new NextButton(layout);
        toolbar.add(next,BorderLayout.EAST);
        this.add(toolbar,BorderLayout.NORTH);

        picturepanel=new JPanel();
        picturepanel.add(new JLabel(new ImageIcon("image.jpg")/*"1160 Scouting App"*/));
        picturepanel.setOpaque(true);
        this.add(picturepanel,BorderLayout.CENTER);

        this.setPreferredSize(new Dimension(800,600));
    }


}
